package cn.k7g.alloy.ioc.provide;

import cn.k7g.alloy.expose.DataProvider;
import cn.k7g.alloy.mold.var.AbsVar;
import cn.k7g.alloy.mold.var.ConstVar;
import org.springframework.stereotype.Component;

/**
 * 常量处理器
 * @author victor-wu
 * @date 2021/9/27 下午1:10
 */
@Component
public final class ConstDataProvide implements DataProvider<Object> {
    @Override
    public boolean supports(AbsVar var) {
        return var instanceof ConstVar;
    }

    @Override
    public Object get(AbsVar var) {
        return var.getFirstParam();
    }
}
